///////////////////////////////////////////////////////////////////////////////////////////////////
/// \file timing.h
///
/// \brief   declarations of functions and classes used in timing the code
///
///////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef PCPS_TIMING_HEADER
#define PCPS_TIMING_HEADER

#include <string>

//#include <src/pcps.h>

namespace pcps {

  ///////////////////////////////////////////////////////////////////////////////////////////////////
  /// \brief   A class for keeping track of elapsed time
  ///
  ///////////////////////////////////////////////////////////////////////////////////////////////////
  class Stopwatch {
    public:
      Stopwatch();
      void reset();
      void start();
      void stop();
      double elapsed_seconds() const;
    private:
      bool _running; ///< whether the stopwatch is running
      double _start_time; ///< when the clock was started
      double _elapsed_time; ///< elapsed time after most recent stop
  };

  void print_timers();
  void start_timer(const std::string & name);
  void stop_timer(const std::string & name);
  void reset_timer(const std::string & name);

} // end namespace pcps

#endif
